package com.zy.config.feign;

import com.zy.config.dto.AppConfigDetailsDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotBlank;
import java.util.List;
import java.util.Properties;

/**
 * @author 308237306_33141
 * @description:
 * @since 2023/3/19 15:03
 */
@FeignClient(
        name = "CONFIG",
        contextId = "CONFIG"
)
@RequestMapping(value = "/config")
@Api(tags = "BOM接口", value = "BOM相关接口")
@Validated
public interface PropertyFeign {

    @GetMapping({"/property"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    Properties property(@RequestParam @NotBlank String appId);

    @GetMapping({"/propertyString"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    String propertyToString(@NotBlank @RequestParam String appId);

    @GetMapping({"/propertyToList"})
    @ApiOperation(
            value = "获取配置",
            notes = "获取配置"
    )
    List<AppConfigDetailsDto> propertyToList(@RequestParam @NotBlank String appId);

}